/*
 * Main.java
 *
 * Created on 9 de marzo de 2006, 11:39
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

package NativeRobot;

import java.awt.event.InputEvent;
import java.awt.event.KeyEvent;
import java.awt.event.MouseEvent;

/**
 * Programa de ejemplo
 *
 * @author Francisco J. Hdez Hdez
 */
public class Main {
    
    /** Creates a new instance of Main */
    public Main() {
    }
    
    public static void main(String[] args) {
        NativeRobot robot = null;
        try {
            robot = new NativeRobot();
        } catch (Exception e) {
            System.out.println("Error: " + e.getStackTrace());
            System.exit(1);
        }
        robot.setNativeMode(true);
        System.out.println("Mouse: " + robot.getMousePos());
        robot.setNativeMode(true);
        System.out.println("Boton izq: " + robot.isButtonPressed(MouseEvent.BUTTON1));
        robot.setNativeMode(true);
        System.out.println("Pausa: " + robot.isButtonPressed(KeyEvent.VK_PAUSE));
        robot.setNativeMode(true);
        System.out.println(robot.findAllTittleWindow("sist", true));
        System.out.println(robot.findAllTittleWindow("Ultima", true));
        robot.setNativeMode(true);
        System.out.println("Color: " + robot.getPixelColor(100,200));
        robot.setNativeMode(true);
        robot.setActWinTittle(robot.getActWinTittle());
        robot.setNativeMode(true);
        robot.keyPress(java.awt.event.KeyEvent.VK_SHIFT);
        robot.keyPress(java.awt.event.KeyEvent.VK_K);
        robot.mouseMove(620,456);
        robot.mousePress(InputEvent.BUTTON1_MASK);
        robot.mouseRelease(InputEvent.BUTTON1_MASK);
        robot.keyRelease(java.awt.event.KeyEvent.VK_SHIFT);
     }
    
}
